<?php
    $this->assign('title','Conta::Exibindo');
    $this->assign('page_local','Conta');
    $this->assign('page_now','Exibindo Registro');
    $this->assign('panel_title','Exibindo Conta');
    $this->start('content_form');
?>
<div class="panel-body">
    <div class="row mb20">
        <div class="col-sm-6">
            <div class="form-group">
                <label class="control-label">Nome Conta:</label>
                <div class="form-control-feedback"><?php echo h($account['Account']['name']) ?></div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="form-group">
                <label class="control-label">Descrição:</label>
                <div class="control-group">
                    <div class="form-control-feedback"><?php echo h($account['Account']['descricao']) ?></div>
                </div>
            </div>
        </div>
    </div>
    <div class="panel-footer">
        <?php echo $this->Html->link('<span class="glyphicon glyphicon-arrow-left"></span> Voltar',array('controller'=>$this->params['controller'],'action'=>'/'),array('class'=>'btn btn-default','escape'=>false)) ?>
        <?php echo $this->Html->link('<span class="glyphicon glyphicon-pencil"></span> Editar',array('controller'=>$this->params['controller'],'action'=>'edit',$account['Account']['id']),array('class'=>'btn btn-primary','escape'=>false)) ?>
        <?php echo $this->Html->link('<span class="glyphicon glyphicon-file"></span> Novo',array('controller'=>$this->params['controller'],'action'=>'add'),array('class'=>'btn btn-success','escape'=>false)) ?>
        <?php echo $this->Form->postLink('<span class="glyphicon glyphicon-trash"></span> Excluir', array('action' => 'delete', $account['Account']['id']), array('escape'=>false,"title"=>"","data-original-title"=>"Deletar Registro","data-placement"=>"top","data-toggle"=>"tooltip","class"=>"tooltips btn btn-link"), __('Deseja realmente excluir o registro # %s?', $account['Account']['id'])); ?>
    </div>
<?php
    $this->end();
    if(!empty($account['PayReceive'])):
        $this->start('content_table');
        ?>
        <caption>Contas a Pagar e Receber</caption>
        <thead>
        <tr>
            <th><?php echo __('Descricao'); ?></th>
            <th><?php echo __('Expense Id'); ?></th>
            <th><?php echo __('Codigo Doc'); ?></th>
            <th><?php echo __('Numero Doc'); ?></th>
            <th><?php echo __('Data Vencimento'); ?></th>
            <th><?php echo __('Valor Doc'); ?></th>
            <th><?php echo __('Data Pagamento'); ?></th>
            <th><?php echo __('Valor Pago'); ?></th>
            <th class="col-sm-1 text-center">#</th>
        </tr>
        </thead>
        <tbody>
        <?php foreach ($account['PayReceive'] as $PayReceive): ?>
            <tr>
                <td><?php echo $PayReceive['descricao']; ?></td>
                <td><?php echo $PayReceive['expense_id']; ?></td>
                <td><?php echo $PayReceive['codigo_doc']; ?></td>
                <td><?php echo $PayReceive['numero_doc']; ?></td>
                <td><?php echo $PayReceive['data_vencimento']; ?></td>
                <td><?php echo $PayReceive['valor_doc']; ?></td>
                <td><?php echo $PayReceive['data_pagamento']; ?></td>
                <td><?php echo $PayReceive['valor_pago']; ?></td>
                <td class="table-action">
                    <?php echo $this->Html->link('<i class="fa fa-eye"></i>', array('action' => 'view', $account['Account']['id']),array("data-placement"=>"top","data-toggle"=>"tooltip","class"=>"tooltips",'escape'=>false,"title"=>"","data-original-title"=>"Ver Registro")); ?>

                    <?php echo $this->Html->link('<i class="fa fa-pencil"></i>', array('action' => 'edit', $account['Account']['id']),array("data-placement"=>"top","data-toggle"=>"tooltip","class"=>"tooltips",'escape'=>false,"title"=>"","data-original-title"=>"Editar Registro")); ?>

                    <?php echo $this->Form->postLink('<i class="fa fa-trash-o"></i>', array('action' => 'delete', $account['Account']['id']), array('escape'=>false,"title"=>"","data-original-title"=>"Deletar Registro","data-placement"=>"top","data-toggle"=>"tooltip","class"=>"tooltips"), __('Deseja realmente excluir o registro # %s?', $account['Account']['id'])); ?>
                </td>
            </tr>
        <?php endforeach; ?>
        </tbody>
        <?php
        $this->end();
    endif;
?>